package com.example.controller;

import com.example.util.StaticStringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/tt")
public class TestStaticController {

    private static final Logger logger = LoggerFactory.getLogger(TestStaticController.class);

    @RequestMapping(value = "/sskey")
    public String getsskey(){
        return StaticStringUtil.getSskey();
    }


    @RequestMapping(value = "/rt")
    public String rtString() {
        try {
            logger.info("------正常开始------");
            int i = 10 / 0;
            logger.info("------正常结束------");
            return i + " = 正常";
        } catch (Exception e) {
            logger.info("------异常------");
            return "异常";
        } finally {
            logger.info("------最终------");
        }
    }
}
